<%= form_for [:admin, @membership], html: { class: "card" } do |f| %>
  <div class="card-body">
    <h3 class="card-title"><%= @membership.new_record? ? "创建" : "修改" %>会员等级</h3>
    <div class="row">
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">名字</label>
          <%= f.text_field :name, class: "form-control" %>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">会员等级LOGO</label>
          <div class="custom-file">
            <%= f.file_field :avatar, class: "custom-file-input" %>
            <label class="custom-file-label">选择文件</label>
          </div>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">品牌大尺寸LOGO<small>750x430</small></label>
          <div class="custom-file">
            <%= f.file_field :big_avatar, class: "custom-file-input" %>
            <label class="custom-file-label">选择文件</label>
          </div>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">是否可用</label>
          <div class="custom-controls-stacked">
            <label class="custom-control custom-checkbox">
              <%= f.check_box :published, class: "custom-control-input" %>
              <span class="custom-control-label">勾选就在前端显示</span>
            </label>
          </div>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">折扣率</label>
          <%= f.number_field :discount, class: "form-control", min: "0" %>
        </div>
      </div>
      <div class="col-md-4">
        <div class="form-group">
          <label class="form-label">售价</label>
          <%= f.number_field :price, class: "form-control", min: "0.0" %>
        </div>
      </div>
    </div>
  </div>
  <div class="card-footer text-right">
    <%= f.submit "保 存", class: "btn btn-primary" %>
  </div>
<% end %>